package ACWing.TheNnderlyingAlgorithm.前缀差分;
//797. 差分
import java.util.Scanner;

/**
 * @author :chenjie
 * @date :Created 2022/11/17 21:27
 */
public class Difference {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int p=sc.nextInt();
        int[]arr=new int[n+1];
        int[]b=new int[n+1];
        for (int i = 1; i <= n; i++) {
            arr[i]=sc.nextInt();
            b[i]=arr[i]-arr[i-1];
        }

        while (p--!=0){
            int x=sc.nextInt();
            int y=sc.nextInt();
            int c=sc.nextInt();
            b[x]=b[x]+c;
            if(y<n){
                b[y+1]=b[y+1]-c;
            }
        }

        for (int i = 1; i <= n; i++) {
            b[i]=b[i-1]+b[i];
            System.out.print(b[i]+" ");
        }

    }

}
